<?php
ini_set("display_errors", "On");
error_reporting(E_ERROR | E_PARSE | E_CORE_ERROR | E_WARNING | E_COMPILE_ERROR);
if($_SERVER["SERVER_NAME"]=='qiyue.zhongsou.com' || $_SERVER["SERVER_NAME"]=='qiyuenew.zhongsou.com'){
ini_set('session.save_handler', 'redis');
ini_set('session.save_path', 'tcp://103.7.222.41:6399');
}
session_set_cookie_params(36000);
ini_set('session.gc_maxlifetime',36000);
session_start();
header('Content-Type: text/html; charset=UTF-8');
header("Cache-Control:no-cache,must-revalidate");
header("Pragma:no-cache");
set_time_limit(0);
ini_set('date.timezone','Asia/Shanghai');
define("ROOTDIR",$_SERVER['DOCUMENT_ROOT']."/");
include ROOTDIR."include/lxbase.class.php";
include ROOTDIR."public/func.php";
define("CPATH","controller/");
define("CPOSTFIX",".class");
$app_path= str_replace($_SERVER['DOCUMENT_ROOT'], '', __FILE__);    
$app_request=trim(str_replace($app_path, '', $_SERVER['REQUEST_URI']),"/");
$urlinfo = Lxbase::urlreload($app_request);
$path = empty($urlinfo["path"])?"index/":strtolower($urlinfo["path"])."/";
$model = empty($urlinfo["model"])?"Index_con":ucfirst(strtolower($urlinfo["model"]))."_con";
$func = empty($urlinfo["function"])?"index":$urlinfo["function"];
$murl=empty($urlinfo["model"])?"index":strtolower($urlinfo["model"]);
$exemp = Lxbase::getconfig('exemp');
if(!isset($exemp[$murl][$func]) && empty($_SESSION["userinfo"])){
    if($path=="other/" && $model=="Packinfo_con"  ){
        header("location:http://vq.zhongsou.com".$_SERVER['REQUEST_URI']);  //打包的下载地址 http://vq.zhongsou.com/index.php?g=Other&m=Packinfo&a=index&uid=622
    }
	if($path=='pc/' && in_array($func,array('showindex','showlist','showview'))){
		
	}elseif($path=='wap/' && $model=='Index_con' && $func=='index'){
		
	}else{
        Lxbase::gologin();
    }
}
include (ROOTDIR.CPATH.$path.$murl.CPOSTFIX.".php");
if(!class_exists($model)) die('没有找到类'.$model);
$obj = new $model();
if(method_exists($obj,'setinit')){
	$obj->setinit($path);
}
$obj->$func();